package com.desire.consumer;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class DirectConsumer {

    @RabbitListener(queues = {"commonlog"})
    public void handerCommonLog(Message message) {
        System.out.println("通用日志接收：" + new String(message.getBody()));
    }

    @RabbitListener(queues = {"errorlog"})
    public void handerErrorLog(Message message) {
        System.out.println("错误日志接收：" + new String(message.getBody()));
    }
}
